1 About

The western United States is seeing an increase in catastrophic wildfire in virtually all climate types and across a broad range of elevations. Many of these fires burn in forested headwaters that communities rely on for water supply, underscoring the need for a greater understanding of how fire changes streamflow timing and magnitude. Though many studies have examined the hydrologic response to fire, the site-specific nature of this type of research has made it difficult to generalize findings. The 2020 Cameron Peak fire in Colorado burned across a broad elevation gradient, making it an ideal case study for examining how the post-fire impact to streamflow generation varies with temperature, aridity, and seasonal snow cover.

We selected three watersheds—unburned, partially burned, and severely burned—in each of two snow zones: the high-elevation persistent snow zone, and the mid-elevation intermittent snow zone. These watersheds were instrumented to monitor snow accumulation and ablation, rainfall, and stream discharge throughout water year 2021. We compared streamflow responses to rainfall and snowmelt between watersheds to evaluate how burning affected runoff. At high elevations, snowmelt runoff began earlier in the burned watersheds, which experienced greater total flow and lower base flows compared to the unburned watershed. The results were similar for the low elevation sites, though less pronounced for snowmelt runoff. At all elevations, streamflow at the burned sites was more responsive to rainfall, with the low elevation sites exhibiting a much more rapid rise to peak discharge than the high elevation sites. The results demonstrate that the streamflow responses to fire vary between snow zones, indicating a need to account for elevation and snow persistence in post-fire risk assessments.

1.1 Usage

Each bookdown chapter is an .Rmd file, and each .Rmd file can contain one (and only one) chapter. A chapter must start with a first-level heading: # A good chapter, and can contain one (and only one) first-level heading.

Use second-level and higher headings within chapters like: ## A short section or ### An even shorter section.

The index.Rmd file is required, and is also your first book chapter. It will be the homepage when you render the book.

1.2 Render book

You can render the HTML version of this example book without changing anything:

  1. Find the Build pane in the RStudio IDE, and

  2. Click on Build Book, then select your output format, or select “All formats” if you’d like to use multiple formats from the same book source files.

Or build the book from the R console:

bookdown::render_book()

To render this example to PDF as a bookdown::pdf_book, you’ll need to install XeLaTeX. You are recommended to install TinyTeX (which includes XeLaTeX): https://yihui.org/tinytex/.

1.3 Preview book

As you work, you may start a local server to live preview this HTML book. This preview will update as you edit the book when you save individual .Rmd files. You can start the server in a work session by using the RStudio add-in “Preview book,” or from the R console:

bookdown::serve_book()

2 Methods

In each of our study watersheds we collected precipitation data using a tipping bucket rain gauge and continuous stream depth using either a capacitance rod or pressure transducer. We also measured stream discharge monthly from April to November 2021. When measuring discharge, we recorded stream stage manually in order to calibrate the sensor data (Fig. @ref(fig:pics))

Left: Blue Lake 4 (a tributary to Blue Lake) in June 2021. Right: Staff plate for manual stream stage measurementLeft: Blue Lake 4 (a tributary to Blue Lake) in June 2021. Right: Staff plate for manual stream stage measurement

(#fig:pics)Left: Blue Lake 4 (a tributary to Blue Lake) in June 2021. Right: Staff plate for manual stream stage measurement

2.1 Site Description

For this class report, I will consider two of my field sites– Blue Lake 4 and Michigan Ditch (Table @ref(tab:descr-tab)). In chapter 4, I will compare our data collection at the Michigan Ditch tributary to the data collected at the nearby USGS Michigan River gage.

(#tab:descr-tab)Properties of the watersheds in this study
Watershed Slope Aspect Elevation (m) Area (sq.km) Snow Zone Burn Status
Bighorn 19 SE 2987.988 3.396600 intermittent unburned
Washout 33 E/SE 2455.392 2.695772 intermittent partially burned
Dry 18 E/SE 2753.429 2.520000 intermittent severely burned
Michigan Ditch 19 W/SW 3462.576 1.359900 persistent unburned
Montgomery 8 E/SE 3070.066 1.887741 persistent partially burned
Blue Lake 4 13 E/NE 3065.140 0.999655 persistent severely burned

An unnumbered section

Chapters and sections are numbered by default. To un-number a heading, add a {.unnumbered} or the shorter {-} at the end of the heading, like in this section.

3 Data Processing

The goal is to compare rainfall and discharge data in order to compute the following metrics: 1) total quantity of response flow, 2) magnitude of peak response discharge, 3) duration of response, 4) lag to peak time (start time of storm to time of peak discharge), and 5) runoff ratio (depth of Q (mm) divided by the depth of rainfall (mm) for the rain storm associated with the runoff response).

3.1 Precipitation

Before starting this analysis, I identified discrete rainfall events from the tipping bucket rain gauge output using the USDA Rainfall Intensity Summarization Tool (RIST; (ARS 2013)). RIST calculated the following metrics for each event: storm duration (hrs), rain depth (mm); maximum intensity (mm h−1) over 5-, 15-, 30-, and 60-min intervals; and erosivity. Because the stage data is recorded every 15 minutes, I’m using the start time of the maximum intensity 15 minute interval as the storm start time. The function below formats the RIST output into the form I want.

#function to read in rain files
rain_reader <- function(rain_file){
  df <-read.delim(rain_file, sep = "", header = TRUE) %>%
  select(-c(1,3:7))
}

#function to process the storm output 
rain_format <- function(rain_file){
  df<- rain_file %>%
  select(Max_15_start_date, Max_15_start_time, Precip.in.) %>%
  rename(date =1, time=2, p_in =3) %>%
  mutate(datetime = paste(date, time, sep = " ")) %>%
  filter(!(p_in ==0)) %>%
  mutate(p_mm = p_in*25.4) %>%
  mutate(DateTime = mdy_hms(datetime, tz = "GMT"))  
}

#read in and format michigan ditch and bl4 rain data
mich_rain <- rain_reader("raw_sitedata/michiganditch/michigan_storm.txt")
bl4_rain <- rain_reader("raw_sitedata/bl4/bl4_storm.csv")

mich_storm <- rain_format(mich_rain)
bl4_storm <- rain_format(bl4_rain)

3.2 Stream Stage

Michigan Ditch stream stage was recorded by a pressure transducer that doesn’t take into account atmospheric pressure, so the data needs to be corrected using barometic data. The continuous stage data is then calibrated according to the manual stage measurements.

#read in pt data
michiganditch_stage_pt=read_csv('raw_sitedata/michiganditch/michiganditch_stage_composite_pt.csv', show_col_types = FALSE) %>%
  rename(Pw_kPa = 3)
michiganditch_stage_pt$DateTime = as_datetime(michiganditch_stage_pt$datetime,tz="GMT", format="%m/%d/%Y %H:%M")

#read in baro data
michiganditch_baro=read_csv('raw_sitedata/michiganditch/michiganditch_baro_composite.csv', show_col_types = FALSE) %>%
  filter(!is.na(Pressure_kPa)) %>%
  rename(Pa_kPa = 2)
michiganditch_baro$DateTime = as_datetime(michiganditch_baro$datetime,tz="GMT", format="%m/%d/%Y %H:%M")

#join pt and baro and convert to stage in cm
mich_stage = full_join(michiganditch_baro, michiganditch_stage_pt, by="DateTime",all=TRUE) %>%
  mutate(stage_kPa = Pw_kPa - Pa_kPa) %>%
  mutate(stage_cm = (stage_kPa*101.97162129779)/10) %>%
  select(DateTime, stage_cm)

#read in file with manual stage measurements
discharge_michiganditch=read_csv('raw_sitedata/michiganditch/discharge_michiganditch.csv', show_col_types = FALSE)
discharge_michiganditch$DateTime = as.POSIXct(discharge_michiganditch$datetime,tz="GMT",format="%m/%d/%Y %H")

#merge the manual discharge measurements with the sensor time series
michditch_stage=full_join(mich_stage,discharge_michiganditch,by='DateTime') %>%
  select(1,2,7,9) 

#correct stage based on manual stage measurements
michditch_stage<-mutate(michditch_stage, stage_corr_cm = stage_cm)

#offset adjust
michditch_stage$stage_corr_cm=ifelse(michditch_stage$DateTime >ymd_hms('2021-06-21 10:30:00'),
                                     michditch_stage$stage_corr_cm-1,michditch_stage$stage_corr_cm)

michditch_stage$stage_corr_cm=ifelse(michditch_stage$DateTime>ymd_hms('2021-08-05 11:00:00'),
                                     michditch_stage$stage_corr_cm-2.3,michditch_stage$stage_corr_cm)

#delete sensor spikes
michditch_stage <- michditch_stage %>%
  filter(!(DateTime < ymd_hms("2021-01-10 09:30:00") |
             DateTime == ymd_hms("2021-06-21 09:45:00") |
             stage_corr_cm <= 0))

#plot the sensor and manual stage time series
michiganditch=ggplot()+
  geom_line(data=michditch_stage,aes(x=DateTime,y=stage_corr_cm))+
  geom_point(data=michditch_stage, aes(x=DateTime,y=manual_stage_cm),color='red')+
  labs(x= "Time", y= "Stage (cm)") +
  theme_bw()
  
ggplotly(michiganditch)

(#fig:michigan)Michigan Ditch stream stage. The red dots indicate manual stage measurements.

3.3 Discharge

3.4 Chapters and sub-chapters

There are two steps to cross-reference any heading:

  1. Label the heading: # Hello world {#nice-label}.
    • Leave the label off if you like the automated heading generated based on your heading title: for example, # Hello world = # Hello world {#hello-world}.
    • To label an un-numbered heading, use: # Hello world {-#nice-label} or {# Hello world .unnumbered}.
  2. Next, reference the labeled heading anywhere in the text using \@ref(nice-label); for example, please see Chapter @ref(cross).

3.5 Captioned figures and tables

Figures and tables with captions can also be cross-referenced from elsewhere in your book using \@ref(fig:chunk-label) and \@ref(tab:chunk-label), respectively.

See Figure @ref(fig:nice-fig).

par(mar = c(4, 4, .1, .1))
plot(pressure, type = 'b', pch = 19)
Plot with connected points showing that vapor pressure of mercury increases exponentially as temperature increases.

(#fig:nice-fig)Here is a nice figure!

Don’t miss Table @ref(tab:nice-tab).

knitr::kable(
  head(pressure, 10), caption = 'Here is a nice table!',
  booktabs = TRUE
)
(#tab:nice-tab)Here is a nice table!
temperature pressure
0 0.0002
20 0.0012
40 0.0060
60 0.0300
80 0.0900
100 0.2700
120 0.7500
140 1.8500
160 4.2000
180 8.8000

4 Comparison of Salt Dilution to USGS Gage

You can add parts to organize one or more book chapters together. Parts can be inserted at the top of an .Rmd file, before the first-level chapter heading in that same file.

Add a numbered part: # (PART) Act one {-} (followed by # A chapter)

Add an unnumbered part: # (PART\*) Act one {-} (followed by # A chapter)

Add an appendix as a special kind of un-numbered part: # (APPENDIX) Other stuff {-} (followed by # A chapter). Chapters in an appendix are prepended with letters instead of numbers.

5 Footnotes and citations

5.1 Footnotes

Footnotes are put inside the square brackets after a caret ^[]. Like this one.1

5.2 Citations

Reference items in your bibliography file(s) using @key.

For example, we are using the bookdown package (Xie 2022) (check out the last code chunk in index.Rmd to see how this citation key was added) in this sample book, which was built on top of R Markdown and knitr (Xie 2015) (this citation was added manually in an external file book.bib). Note that the .bib files need to be listed in the index.Rmd with the YAML bibliography key.

The RStudio Visual Markdown Editor can also make it easier to insert citations: https://rstudio.github.io/visual-markdown-editing/#/citations

References

ARS. 2013. Rainfall Intensity Summarization Tool (RIST) (Version 3.89). United States Department of Agriculture. http://www.ars.usda.gov/Research/docs.htm?docid=3251.
Xie, Yihui. 2015. Dynamic Documents with R and Knitr. 2nd ed. Boca Raton, Florida: Chapman; Hall/CRC. http://yihui.org/knitr/.
———. 2022. Bookdown: Authoring Books and Technical Documents with r Markdown. https://CRAN.R-project.org/package=bookdown.

  1. This is a footnote.↩︎